package com.bluemedia.bookproject.pages;

import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import org.vaadin.navigator7.Navigator;
import org.vaadin.navigator7.Page;
import org.vaadin.navigator7.ParamChangeListener;
import org.vaadin.navigator7.uri.Param;

/**
 * Created by IntelliJ IDEA.
 * User: kaafaar
 * Date: 12.04.11
 * Time: 22:56
 * To change this template use File | Settings | File Templates.
 */
@Page
public class ProductPage extends VerticalLayout implements ParamChangeListener {

    Label productDescriptionLabel = new Label("I'm a product");

    @Param(name = "p") int id;

    public ProductPage() {
        // Main info about the current product
        addComponent(productDescriptionLabel);
    }

    @Override
    public void paramChanged(Navigator.NavigationEvent event) {
        System.out.println("Parameters have been changed. Now they are: " + event.getParams());
        System.out.println("Param p="+id);
    }

}

